package com.purchase.jd.http;

import java.util.HashMap;
import java.util.Map;

/**
 * @author saw
 */
public class HttpHeaders {

    public final static String HEADER_AGENT = "User-Agent";
    public final static String HEADER_AGENT_ARG = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36";
    public final static String REFERER = "Referer";
    public final static String REFERER_ARG = "https://passport.jd.com/new/login.aspx";

    public static Map<String,String> headers;

    public static Map<String,String> getHeaders(){
        if(null == headers){
            headers = new HashMap<>(16);
            headers.put(HttpHeaders.HEADER_AGENT, HttpHeaders.HEADER_AGENT_ARG);
            headers.put(HttpHeaders.REFERER, HttpHeaders.REFERER_ARG);
        }
        return headers;
    }
}
